<template>
  <div class="right-container">
    <h2>Right 组件</h2>
    <button @click="postInfo">发起poat 请求</button>
    <br>
    <br>
    <button @click="getBooks">获取图书列表</button>
  </div>
</template>

<script>
// import axios from 'axios'
export default {
  methods: {
    postInfo() {
      this.$http({
        method: 'post',
        url: '/api/post'
      }).then(function(res) {
        console.log(res.data)
      })
    },
    getBooks() {
      this.$http({
        method: 'get',
        url: '/api/getbooks'
      }).then(function(res) {
        console.log(res.data)
      })
    }
  }
}
</script>

<style lang="less" scoped>
  .right-container{
    background-color: purple;
    min-height: 200px;
    color: white;
    flex: 1;
  }
</style>
